#include <bits/stdc++.h>

using namespace std;

int main() {
    vector<vector<double>> weights(3);
    vector<int> varible;
    vector<double> bias;
    vector<string> comp;
    vector<bool> correct(3, false);

    double tmp;
    for (int j = 0; j < 3; ++j) {
        for (int i = 0; i < 5; ++i) {
            cin >> tmp;
            weights[j].push_back(tmp);
            cin.ignore();
        }
    }
    int tmp1;
    for (int i = 0; i < 5; ++i) {
        cin >> tmp1;
        varible.push_back(tmp1);
        cin.ignore();
    }
    for (int i = 0; i < 3; ++i) {
        cin >> tmp;
        bias.push_back(tmp);
        cin.ignore();
    }
    // cout << << endl;
    // cin.ignore();
    string tmp_s;
    cin >> tmp_s;
    // cout << tmp_s << endl;
    int begin = 0;
    int end = 0;
    while (end != tmp_s.size()) {
        if (tmp_s[end] == ',') {
            comp.push_back(tmp_s.substr(begin, end-begin));
            begin = ++end;
        } else {
            end++;
        }
    }
    comp.push_back(tmp_s.substr(begin, end-begin));

    // cout <<comp[2] << " " << comp[1];

    // process
    bool init = false;
    double max_sub_res;
    for (int i = 0; i < 3 ; ++i) {
        double left = 0;
        for (int j = 0; j < varible.size(); ++j) {
            left += varible[j]*weights[i][j];
        }
        if (comp[i] == ">=" && (left >= bias[i])) {
            correct[i] = true;
        } else if (comp[i] == ">" && (left > bias[i])) {
            correct[i] = true;
        } else if (comp[i] == "<=" && (left <= bias[i])) {
            correct[i] = true;
        } else if (comp[i] == "<" && (left < bias[i])) {
            correct[i] = true;
        } else if (comp[i] == "=" && (left == bias[i])) {
            correct[i] = true;
        } 
        if (!init) {
            max_sub_res = left - bias[i];
        } else {
            max_sub_res = max(max_sub_res, left-bias[i]);
        }
    }
    if (correct[0]&&correct[1]&&correct[2]) {
        cout << "true " << (int)floor(max_sub_res);
    } else {
        cout << "false " << (int)floor(max_sub_res);
    }
    
}